<div class="content-section implementation GridDemo clearfixes">
    <form class="form-horizontal storage" [formGroup]="inventoryForm"   *ngIf="viewState === 'apply' " >
      <p-panel >
        <p-header>
          <div class="ui-helper-clearfix">
            <span class="ui-panel-title" style="font-size:16px;display:inline-block;margin-top:2px"></span>
              <button class="save"  pButton type="button"  label="返回" (click)="goBack()"  > </button>
            <button class="save" pButton type="submit" [ngStyle]="{'float':'right'}" (click)="formSave()" label="保存"  ></button>
            <button class="save"  pButton type="submit" [ngStyle]="{'float':'right'}" label="提交" (click)="formSubmit()"   ></button>
          </div>
        </p-header>
        <div class="ui-grid ui-grid-responsive ui-grid-pad ui-fluid" style="margin: 10px 0px">

            <div class="ui-grid-row margin-bottom-1vw">
              <div class="ui-grid-col-1 ui-padding-10px text-right">
                <label >入库单号:</label>
              </div>
              <div class="ui-grid-col-5">
                <input  formControlName="sid"  name="inspectionName"   type="text" pInputText   placeholder="系统自动获取" [(ngModel)]="submitData.sid"  readonly>
              </div>
              <div class="ui-grid-col-1 text-right">
                <label >经手人:</label>
              </div>
              <div class="ui-grid-col-5">
                <input formControlName="keeper_pid"  name="keeper_pid"  type="text" pInputText   placeholder="入库经手人" [(ngModel)]="personalData.name" readonly >
              </div>
            </div>
            <div class="ui-grid-row margin-bottom-1vw">
              <div class="ui-grid-col-1 text-right">
                <label ><span>*</span>库存位置:</label>
              </div>
              <div class="ui-grid-col-3">
                <input formControlName="inspectiondepartment"  type="text" pInputText  name="inspectiondepartment" placeholder="库存位置"
                       readonly class="cursor_not_allowed"  [(ngModel)]="submitData.location" />
                <div class="ui-message ui-messages-error ui-corner-all "   *ngIf="!inventoryForm.controls['inspectiondepartment'].valid&&(!inventoryForm.controls['inspectiondepartment'].untouched)" >
                  <i class="fa fa-close"></i>
                  库存位置必填
                </div>
              </div>
              <div class="ui-grid-col-1">
                <button pButton  type="button" (click)="showLoactionMask('add')" label="选择" ></button>
              </div>
              <div class="ui-grid-col-1">
                <button pButton  (click)="clearTreeDialog()" label="清空" ></button>
              </div>
              <div class="ui-grid-col-1 text-right">
                <label >仓库管理员:</label>
              </div>
              <div class="ui-grid-col-3">
                <input  formControlName="keeper" type="text" pInputText  name="keeper" placeholder="仓库管理员"
                        readonly class="cursor_not_allowed"  *ngIf="viewState === 'apply'"/>
              </div>
              <div class="ui-grid-col-1">
                <button pButton  type="button"  label="选择"  name="fdsffe"  ></button>
              </div>
              <div class="ui-grid-col-1">
                <button pButton  type="button"  label="清空" name="fdsf"  ></button>
              </div>
            </div>
            <div class="ui-grid-row margin-bottom-1vw">
              <div class="ui-grid-col-1 text-right">
                <label ><span></span>简述:</label>
              </div>
              <div class="ui-grid-col-11">
                <textarea formControlName="remarks" name="jianshu" pInputTextarea type="text" [(ngModel)]="submitData.remarks" ></textarea>
              </div>
            </div>
        </div>
      </p-panel>

    <div class="ui-grid-row margin-bottom-1vw">
      <div class="ui-grid-col-2">
      </div>
    </div>
    <label></label>
  <div class="" >
    <div class="ui-g">
      <div class="ui-g-10 ui-sm-12" >
        <div class="ui-g-2  ui-sm-5 ui-fluid">
        </div>
        <div class="ui-g-2 ui-sm-5 ui-fluid  ui-no-padding-right-15px ">
        </div>
      </div>
      <div class="ui-g-2 ui-sm-12" >
        <div class="ui-g-6  ui-sm-6  ui-fluid">
          <button   pButton   (click)="deleteStorage()" label="移除" [disabled]="selectInsepections.length===0" ></button>
        </div>
        <div class="ui-g-6 ui-sm-6 ui-fluid  ui-no-padding-right-15px ">
          <button pButton   (click)="showAddStorageMask('add')" label="物品选择" ></button>
        </div>
      </div>

    </div>
  </div>
  <label><span>*</span>入库列表</label>
  <p-dataTable [value]="inspections" (onLazyLoad)="loadCarsLazy($event)" [lazy]="true" [rows]="10" [paginator]="true"
               [totalRecords]="totalRecords"  [(selection)]="selectInsepections"  *ngIf="viewState === 'apply'">
    <p-column [style]="{'width':'38px'}" selectionMode="multiple"></p-column>
    <p-column  *ngFor="let col of cols" field="{{col.field}}" header="{{col.header}}"></p-column>
    <p-column header="操作">
      <ng-template let-car="rowData" pTemplate="body" let-i="rowIndex">
      <button pButton type="button" label="编辑" (click)="updateOption(dataSource[i],'update',i)"></button>
      <button pButton type="button" label="查看" (click)="updateOption(dataSource[i],'show',i)"></button>
      </ng-template>
    </p-column>
    <ng-template pTemplate="emptymessage">
      当前没有数据
    </ng-template>
  </p-dataTable>
  </form>
    <form class="form-horizontal storage" [formGroup]="inventoryForm" *ngIf="viewState === 'update' " >
      <p-panel >
        <p-header>
          <div class="ui-helper-clearfix">
            <span class="ui-panel-title" style="font-size:16px;display:inline-block;margin-top:2px"></span>
              <button class="save"  pButton type="button"  label="返回" (click)="updategoBack()"  > </button>
            <button class="save" pButton type="submit" [ngStyle]="{'float':'right'}" (click)="formSave()" label="保存" ></button>
            <button class="save"  pButton type="submit" [ngStyle]="{'float':'right'}" label="提交" (click)="formSubmit()"  ></button>
          </div>
        </p-header>
        <div class="ui-grid ui-grid-responsive ui-grid-pad ui-fluid" style="margin: 10px 0px">

            <div class="ui-grid-row margin-bottom-1vw">
              <div class="ui-grid-col-1 ui-padding-10px text-right">
                <label >入库单号:</label>
              </div>
              <div class="ui-grid-col-5">
                <input  formControlName="sid"  name="inspectionName"   type="text" pInputText   placeholder="入库单号"  value="{{borrowData?.sid}}" readonly>
              </div>
              <div class="ui-grid-col-1 text-right">
                <label >经手人:</label>
              </div>
              <div class="ui-grid-col-5">
                <input formControlName="keeper_pid"  name="keeper_pid"  type="text" pInputText   placeholder="入库经手人" value="{{borrowData?.creator}}" >
              </div>
            </div>
            <div class="ui-grid-row margin-bottom-1vw">
              <div class="ui-grid-col-1 text-right">
                <label ><span>*</span>库存位置:</label>
              </div>
              <div class="ui-grid-col-3">
                <input formControlName="inspectiondepartment"  type="text" pInputText  name="inspectiondepartment" placeholder="库存位置"
                       readonly class="cursor_not_allowed"  [(ngModel)]="borrowData.location"/>
                <div class="ui-message ui-messages-error ui-corner-all "   *ngIf="!inventoryForm.controls['inspectiondepartment'].valid&&(!inventoryForm.controls['inspectiondepartment'].untouched)" >
                  <i class="fa fa-close"></i>
                  库存位置必填
                </div>
              </div>
              <div class="ui-grid-col-1">
                <button pButton  type="button" (click)="showLoactionMask()" label="选择" ></button>
              </div>
              <div class="ui-grid-col-1">
                <button pButton  (click)="clearTreeDialog()" label="清空" ></button>
              </div>
              <div class="ui-grid-col-1 text-right">
                <label >仓库管理员:</label>
              </div>
              <div class="ui-grid-col-3">
                <input  formControlName="keeper" type="text" pInputText  name="keeper" placeholder="仓库管理员"
                        readonly class="cursor_not_allowed"  />
              </div>
              <div class="ui-grid-col-1">
                <button pButton  type="button"  label="选择"  name="fdsffe"  ></button>
              </div>
              <div class="ui-grid-col-1">
                <button pButton  type="button"  label="清空" name="ds" ></button>
              </div>
            </div>
            <div class="ui-grid-row margin-bottom-1vw">
              <div class="ui-grid-col-1 text-right">
                <label ><span></span>简述:</label>
              </div>
              <div class="ui-grid-col-11">
                <textarea formControlName="remarks" name="jianshu" pInputTextarea type="text" [(ngModel)]="borrowData.remarks" ></textarea>
                <!--<div class="ui-message ui-messages-error ui-corner-all"  *ngIf="!inventoryForm.controls['remarks'].valid&&(!inventoryForm.controls['remarks'].untouched)" >-->
                  <!--<i class="fa fa-close"></i>-->
                  <!--简述信息必填-->
                <!--</div>-->
              </div>
            </div>


        </div>

      </p-panel>
  <div class="" >
    <div class="ui-g">
      <div class="ui-g-10 ui-sm-12" >
        <div class="ui-g-2  ui-sm-5 ui-fluid">
        </div>
        <div class="ui-g-2 ui-sm-5 ui-fluid  ui-no-padding-right-15px ">
        </div>
      </div>
      <div class="ui-g-2 ui-sm-12" >
        <div class="ui-g-6  ui-sm-6  ui-fluid">
          <button   pButton   (click)="updateDeleteStorage()" label="移除" [disabled]="selectInsepections.length===0" ></button>
        </div>
        <div class="ui-g-6 ui-sm-6 ui-fluid  ui-no-padding-right-15px ">
          <button pButton   (click)="showAddStorageMask('update')" label="物品选择" ></button>
        </div>
      </div>

    </div>
  </div>
  <label><span>*</span>入库列表</label>

  <p-dataTable [value]="editInspections" (onLazyLoad)="editloadCarsLazy($event)" [lazy]="true" [rows]="10" [paginator]="true"
               [totalRecords]="totalRecords"  [(selection)]="selectInsepections" >
    <p-column [style]="{'width':'38px'}" selectionMode="multiple"></p-column>
    <p-column  *ngFor="let col of cols" field="{{col.field}}" header="{{col.header}}"></p-column>
    <p-column header="操作">
      <ng-template let-car="rowData" pTemplate="body" let-i="rowIndex">
      <button pButton type="button" label="编辑" (click)="updateOption(editDataSource[i],'update',i)"></button>
      <button pButton type="button" label="查看" (click)="updateOption(editDataSource[i],'show',i)"></button>
      </ng-template>
    </p-column>
    <ng-template pTemplate="emptymessage">
      当前没有数据
    </ng-template>
  </p-dataTable>

  </form>
    <form class="form-horizontal storage" [formGroup]="inventoryForm"  *ngIf="viewState === 'viewDetail' ">
      <p-panel >
        <p-header>
          <div class="ui-helper-clearfix">
            <span class="ui-panel-title" style="font-size:16px;display:inline-block;margin-top:2px"></span>
              <button class="save"  pButton type="button"  label="返回" (click)="goBack()"  > </button>
          </div>
        </p-header>
        <div class="ui-grid ui-grid-responsive ui-grid-pad ui-fluid" style="margin: 10px 0px">

            <div class="ui-grid-row margin-bottom-1vw">
              <div class="ui-grid-col-1 ui-padding-10px text-right">
                <label >入库单号:</label>
              </div>
              <div class="ui-grid-col-5">
                <input  formControlName="sid"  name="inspectionName"   type="text" pInputText   placeholder="入库单号"  value="{{borrowData?.sid}}" readonly>
              </div>
              <div class="ui-grid-col-1 text-right">
                <label >经手人:</label>
              </div>
              <div class="ui-grid-col-5">
                <input formControlName="keeper_pid"  name="keeper_pid"  type="text" pInputText   placeholder="入库经手人" value="{{borrowData?.creator}}" readonly>
              </div>
            </div>
            <div class="ui-grid-row margin-bottom-1vw">
              <div class="ui-grid-col-1 text-right">
                <label ><span></span>库存位置:</label>
              </div>
              <div class="ui-grid-col-5">
                <input formControlName="inspectiondepartment"  type="text" pInputText  name="inspectiondepartment" placeholder="库存位置"
                       readonly class="cursor_not_allowed"  [(ngModel)]="borrowData.location"  />
              </div>
              <div class="ui-grid-col-1 text-right">
                <label >仓库管理员:</label>
              </div>
              <div class="ui-grid-col-5">
                <input  formControlName="keeper" type="text" pInputText  name="keeper" placeholder="仓库管理员"
                        readonly class="cursor_not_allowed" />
              </div>
            </div>
            <div class="ui-grid-row margin-bottom-1vw">
              <div class="ui-grid-col-1 text-right">
                <label ><span></span>简述:</label>
              </div>
              <div class="ui-grid-col-11">
                <textarea formControlName="remarks"  readonly name="jianshu" pInputTextarea type="text" [(ngModel)]="borrowData.remarks" ></textarea>
              </div>
            </div>
            <div class="ui-grid-row margin-bottom-1vw" *ngIf="borrowData.status !=='新建'&& borrowData.status !=='待审批'">
              <div class="ui-grid-col-1 text-right">
                <label ><span></span>审批意见:</label>
              </div>
              <div class="ui-grid-col-11">
                <textarea formControlName="approve_remarks"  readonly name="jianshu" pInputTextarea type="text" [(ngModel)]="borrowData.approve_remarks" ></textarea>
              </div>
            </div>


        </div>

      </p-panel>

    <div class="ui-grid-row margin-bottom-1vw">
      <div class="ui-grid-col-2">
      </div>
    </div>
    <label></label>
  <div class="" *ngIf="viewState !== 'viewDetail'&& viewState !== 'update'">
    <div class="ui-g">
      <div class="ui-g-10 ui-sm-12" >
        <div class="ui-g-2  ui-sm-5 ui-fluid">
        </div>
        <div class="ui-g-2 ui-sm-5 ui-fluid  ui-no-padding-right-15px ">
        </div>
      </div>
      <div class="ui-g-2 ui-sm-12" >
        <div class="ui-g-6  ui-sm-6  ui-fluid">
          <button   pButton   (click)="deleteStorage()" label="删除"[disabled]="selectInsepections.length===0" *ngIf="viewState !== 'viewDetail'&& viewState !== 'update'"></button>
        </div>
        <div class="ui-g-6 ui-sm-6 ui-fluid  ui-no-padding-right-15px ">
          <button pButton   (click)="showAddStorageMask()" label="物品选择" *ngIf="viewState !== 'viewDetail'&& viewState !== 'update'"></button>
        </div>
      </div>

    </div>
  </div>
  <label><span></span>入库列表</label>
  <p-dataTable [value]="inspections" (onLazyLoad)="loadCarsLazy($event)" [lazy]="true" [rows]="10" [paginator]="true"
               [totalRecords]="totalRecords"  [(selection)]="selectInsepections"  *ngIf="viewState === 'apply'">
    <p-column [style]="{'width':'38px'}" selectionMode="multiple"></p-column>
    <p-column  *ngFor="let col of cols" field="{{col.field}}" header="{{col.header}}"></p-column>
    <p-column header="操作">
      <ng-template let-car="rowData" pTemplate="body" let-i="rowIndex">
      <button pButton type="button" label="编辑" (click)="updateOption(dataSource[i],'update',i)"></button>
      <button pButton type="button" label="查看" (click)="updateOption(dataSource[i],'show',i)"></button>
      </ng-template>
    </p-column>
    <ng-template pTemplate="emptymessage">
      当前没有数据
    </ng-template>
  </p-dataTable>
  <p-dataTable [value]="editInspections" (onLazyLoad)="editloadCarsLazy($event)" [lazy]="true" [rows]="10" [paginator]="true"
               [totalRecords]="totalRecords"  [(selection)]="selectInsepections" *ngIf="viewState === 'update' ">
    <p-column [style]="{'width':'38px'}" selectionMode="multiple"></p-column>
    <p-column  *ngFor="let col of cols" field="{{col.field}}" header="{{col.header}}"></p-column>
    <p-column header="操作">
      <ng-template let-car="rowData" pTemplate="body" let-i="rowIndex">
      <button pButton type="button" label="编辑" (click)="updateOption(editDataSource[i],'update',i)"></button>
      <button pButton type="button" label="查看" (click)="updateOption(editDataSource[i],'show',i)"></button>
      </ng-template>
    </p-column>
    <ng-template pTemplate="emptymessage">
      当前没有数据
    </ng-template>
  </p-dataTable>
  <p-dataTable [value]="editInspections" (onLazyLoad)="editloadCarsLazy($event)" [lazy]="true" [rows]="10" [paginator]="true"
               [totalRecords]="totalRecords"  [(selection)]="selectInsepections" *ngIf="viewState === 'viewDetail' ">
    <!--<p-column [style]="{'width':'38px'}" selectionMode="multiple"></p-column>-->
    <p-column  *ngFor="let col of coles" field="{{col.field}}" header="{{col.header}}"></p-column>
    <ng-template pTemplate="emptymessage">
      当前没有数据
    </ng-template>
  </p-dataTable>
  <label></label>
  <div class="ui-grid-row margin-bottom-1vw">
    <div class="ui-grid-col-2">
    </div>
  </div>
  </form>
</div>
<app-add-storage
  *ngIf="showAddStorage"
  (addStorage)="addStorage($event)"
  [state]="state"
  [currentMeterial]="currentMaterial"
  (updateStorage)="updateStorage($event)"
  (closeAddStorage)="closeAddStorageMask($event)">
</app-add-storage>

<app-choose-warehouse-manager
  *ngIf="showWarehouseManager"
  (closeChooseWarehouse)="closeWarehouseManagerMask($event)">
</app-choose-warehouse-manager>

<app-add-inventory-location *ngIf="showLocation" (closeMask)="closeLocationMask($event)" (addTree)="nodeTree($event)" [treeState]="treeState"></app-add-inventory-location>


